﻿/**
 * 
 */
package com.zit.presentation.action;

import java.util.ArrayList;
import java.util.List;

import org.apache.struts2.json.JSONException;
import org.apache.struts2.json.JSONUtil;

import com.zit.entity.Dorm;
import com.zit.service.BedroomService;
import com.zit.service.BerthService;
import com.zit.service.DormService;

public class BerthAction extends BaseAction {
	
	//公寓编号
	private int bid;
	
	//返回所有寝室json字符串
	private String jsonBr;
	
	//实例化BedroomService
	private BerthService berthService=new BerthService();
	
	/**
	 * 作者：唐美兰
	 * 功能：查询该公寓下的所有寝室
	 * @return
	 * @throws JSONException 
	 */
	public String selectBr() throws JSONException{
		jsonBr=JSONUtil.serialize(berthService.select(bid));
		System.out.println(jsonBr);
		return "selectBr";
	}

	public int getBid() {
		return bid;
	}

	public void setBid(int bid) {
		this.bid = bid;
	}

	public String getJsonBr() {
		return jsonBr;
	}

	public void setJsonBr(String jsonBr) {
		this.jsonBr = jsonBr;
	}
}

